namespace WebSOAPUI.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.T_MGT_WebServiceSOAPRequestDataPack",
                c => new
                    {
                        ID = c.Int(nullable: false, identity: true),
                        WebServiceMethodID = c.Int(nullable: false),
                        SOAPRequestDesc = c.String(),
                        DataPack = c.String(),
                        Sort = c.Int(nullable: false),
                        CreatedOn = c.DateTime(nullable: false),
                        DeleteFlag = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.T_MGT_WebServiceMethod",
                c => new
                    {
                        ID = c.Int(nullable: false, identity: true),
                        WebServiceEntityID = c.Int(nullable: false),
                        MethodName = c.String(),
                        MethodDesc = c.String(),
                        SOAPAction = c.String(),
                        Sort = c.Int(nullable: false),
                        CreatedOn = c.DateTime(nullable: false),
                        DeleteFlag = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.ID)
                .ForeignKey("dbo.T_MGT_WebServiceEntity", t => t.WebServiceEntityID, cascadeDelete: true)
                .Index(t => t.WebServiceEntityID);
            
            CreateTable(
                "dbo.T_MGT_WebServiceEntity",
                c => new
                    {
                        ID = c.Int(nullable: false, identity: true),
                        WSDLContent = c.String(),
                        WSDLAddress = c.String(),
                        ServiceName = c.String(),
                        ServiceDesc = c.String(),
                        BindingAddress = c.String(),
                        WsNameSapce = c.String(),
                        Sort = c.Int(nullable: false),
                        CreatedOn = c.DateTime(nullable: false),
                        UpdatedOn = c.DateTime(nullable: false),
                        DeleteFlag = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
        }
        
        public override void Down()
        {
            //DropForeignKey("dbo.T_MGT_WebServiceMethod", "WebServiceEntityID", "dbo.T_MGT_WebServiceEntity");
            //DropIndex("dbo.T_MGT_WebServiceMethod", new[] { "WebServiceEntityID" });
            //DropTable("dbo.T_MGT_WebServiceEntity");
            //DropTable("dbo.T_MGT_WebServiceMethod");
            //DropTable("dbo.T_MGT_WebServiceSOAPRequestDataPack");
        }
    }
}
